<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Administrator
 * Date: 25/05/11
 * Time: 15:03
 * To change this template use File | Settings | File Templates.
 */

class Register
{

    private static $register;

    public static function set($key, $value, $session = false)
    {
        if ($session) {
            $_SESSION[$key] = $value;
        } else {
            self::$register[$key] = $value;
        }
    }

    public static function get($key, $session = false)
    {
        if ($session) {
            return isset($_SESSION[$key]) ? $_SESSION[$key] : null;
        } else {
            return isset(self::$register[$key]) ? self::$register[$key] : null;

        }
    }

    public static function unset_regiseter($key, $bool = false)
    {
        if ($bool) {
            session_unset();
        } else {
            unset($_SESSION[$key]);
        }

    }
}
